package com.kongxiang.cubebit.llm.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.List;

@Data
@Schema(description = "重排序响应结果")
public class ReRankResponse {

    @Schema(description = "请求ID")
    private String id;

    @Schema(description = "重排序结果列表")
    private List<ReRankResult> results;

    @Schema(description = "令牌使用情况")
    private Tokens tokens;

    @Data
    @Schema(description = "重排序结果")
    public static class ReRankResult {

        @Schema(description = "文档信息")
        private Document document;

        @Schema(description = "索引")
        private int index;

        @Schema(description = "相关性得分")
        private double relevance_score;

        @Data
        @Schema(description = "文档信息")
        public static class Document {

            @Schema(description = "文档内容")
            private String text;
        }
    }

    @Data
    @Schema(description = "令牌使用情况")
    public static class Tokens {

        @Schema(description = "输入令牌数")
        private int input_tokens;

        @Schema(description = "输出令牌数")
        private int output_tokens;
    }
}